<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateSetMealsToGoodsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('set_meals_to_goods', function (Blueprint $table) {
            $table->bigIncrements('id')->comment('ID');
            $table->integer('set_meal_id')->index()->nullable()->comment('套餐ID');
            $table->integer('goods_id')->index()->nullable()->comment('商品ID');
            $table->integer('number')->index()->default(1)->comment('商品份数');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('set_meals_to_goods');
    }
}
